package io.github.talelin.latticy.model;

import com.baomidou.mybatisplus.annotation.TableName;
import io.github.talelin.latticy.dto.category.CategoryDTO;
import io.github.talelin.latticy.dto.category.UpdateCategoryDTO;
import io.github.talelin.latticy.dto.warehouse.WarehouseDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 品类
 * ClassName CategoryDO
 * Description
 * Create by zcy
 * Date 2022-06-09
 */
@Data
@TableName("category")
@EqualsAndHashCode(callSuper = true)
public class CategoryDO extends BaseModel implements Serializable {


    private static final long serialVersionUID = 4886045618174102463L;

    /**
     * 父ID
     */
    private Integer parentId;

    /**
     * 品类名称
     */
    private String categoryName;

    /**
     * 品类英文名称
     */
    private String categoryEnglishName;

    /**
     * 等级
     */
    private Integer level;

    public CategoryDO(CategoryDTO dto) {
        BeanUtils.copyProperties(dto, this);
    }

    public CategoryDO(Integer id, UpdateCategoryDTO dto) {
        BeanUtils.copyProperties(dto, this);
        this.setId(id);
    }

    public CategoryDO() {
    }
}
